require 'msf/core/modules/external/bridge'
require 'msf/core/module/external'

class MetasploitModule < Msf::Auxiliary
  include Msf::Auxiliary::Scanner
  include Msf::Module::External

  def initialize
    super({
	  <%= common_metadata meta %>
      'References'  =>
        [
          <%= meta[:references] %>
        ],
      'DisclosureDate' => <%= meta[:date] %>,
      })

      register_options([
        OptInt.new('batch_size', [false, 'Number of hosts to run in each batch', 200]),
        <%= meta[:options] %>
      ])
  end

  def run_batch_size
    datastore['batch_size']
  end

  def run_batch(ips)
    datastore.delete('RHOSTS')
    datastore.remove_option('RHOSTS') if self.datastore.is_a?(Msf::DataStoreWithFallbacks)
    datastore['rhosts'] = ips

    execute_module(<%= meta[:path] %>)
  end
end
